package com.baseweb.webadmin.core.model.mapper;

import com.baseweb.webadmin.core.model.pojo.ByUserBizPackage;
import com.baseweb.webadmin.core.model.pojo.ByUserBizPackageExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface ByUserBizPackageMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    int countByExample(ByUserBizPackageExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    int deleteByExample(ByUserBizPackageExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    @Delete({
        "delete from by_user_biz_package",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    @Insert({
        "insert into by_user_biz_package (user_id, status, ",
        "create_time, ",
        "update_time, ",
        "name)",
        "values (#{userId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler}, ",
        "#{name,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ByUserBizPackage record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    int insertSelective(ByUserBizPackage record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    List<ByUserBizPackage> selectByExample(ByUserBizPackageExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    @Select({
        "select",
        "id, user_id, status, create_time, update_time, name",
        "from by_user_biz_package",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ByUserBizPackage selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    int updateByExampleSelective(@Param("record") ByUserBizPackage record, @Param("example") ByUserBizPackageExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    int updateByExample(@Param("record") ByUserBizPackage record, @Param("example") ByUserBizPackageExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    int updateByPrimaryKeySelective(ByUserBizPackage record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table by_user_biz_package
     *
     * @mbggenerated Fri Feb 10 23:47:35 CST 2017
     */
    @Update({
        "update by_user_biz_package",
        "set user_id = #{userId,jdbcType=INTEGER},",
          "status = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP,typeHandler=com.baseweb.mybatis.typehandler.JodaDateTime2TimestampTypeHandler},",
          "name = #{name,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ByUserBizPackage record);
}